#ifndef __GAMELIGHT_H__
#define __GAMELIGHT_H__

#include "MudBath.h"
#include "App.h"
#include "GameObject.h"
#include "utils/ProceduralPrimitiveFactory.h"

using namespace Ogre;


class GameLight :
	public GameObject,
	public Ogre::FrameListener
{
public:
	GameLight();
//	GameLight(SceneManager* sceneMgr);
//	GameLight(String name, SceneNode* node);
	virtual ~GameLight();


//	virtual void init(Ogre::Root* root);

	void createVisual();

	void drawPointLight();
	void drawDirectionalLight();
	void drawSpotLight();

	bool frameStarted(const Ogre::FrameEvent &evt);
	bool frameEnded(const Ogre::FrameEvent &evt);

	void setShowRange(bool);

	void init();
	void update();

//protected:

	Ogre::Light* mLight;
	Ogre::MaterialPtr mMaterial;

	SceneNode* mNode;
	Entity* mEntity;

	SceneNode* mCamFacingNode;
	SceneNode* mResizingNode;
	SceneNode* mDebugNode;
	SceneNode* mRangeNode;

	ManualObject* mHeightLine;

	static bool mShowDebug;
};

#endif
